package com.training.java.corejava.tdd;

import org.junit.Test;

import junit.framework.TestCase;
 

public class CalculatorTest
{
	@Test
	public void adding_3_and_2_Should_Give_5()
	{
		Calculator cal = new Calculator();
		int result= (int)cal.add(3, 2);
		TestCase.assertEquals(5, result);
	}

	@Test
	public void adding_6_and_5_Should_give_11()
	{
		Calculator cal = new Calculator();
		int result = (int)cal.add(6, 5);
		TestCase.assertEquals(11, result);
	}
	@Test
	public void adding_Decimal_numbers()
	{
		Calculator cal= new Calculator();
		double result=cal.add(2.5, 3.5);
		TestCase.assertEquals(6.0, result);
	}
	@Test
	public void subtracting_3_From_6()
	{
		Calculator cal= new Calculator();
		int result=cal.subtract(6,3);
		TestCase.assertEquals(3, result);
	}
	@Test
	public void subtracting_6_From_3()
	{
		Calculator cal= new Calculator();
		int result=cal.subtract(3,6);
		TestCase.assertEquals(-3, result);
	}
	
	@Test
	public void multiplying_2With2_Gives_4()
	{
		Calculator cal = new Calculator();
		int result= cal.multiply(2,2);
		TestCase.assertEquals(4, result);
		
	}
	@Test
	public void Mutiplying_2With10_Gives_20()
	{
		Calculator cal = new Calculator();
		int result= cal.multiply(2,10);
		TestCase.assertEquals(20, result);
	}
	@Test
	public void Mutiplying_2With0_Gives_0()
	{
		Calculator cal = new Calculator();
		int result= cal.multiply(2,0);
		TestCase.assertEquals(0, result);
	}
	
	@Test
	public void dividing_20With2_Gives_10()
	{
		Calculator cal = new Calculator();
		int result= cal.divide(20,2);
		TestCase.assertEquals(10, result);
	}
	
	
	
}
